package com.market.product.remote;

import com.market.common.core.constant.ServiceNameConstants;
import com.market.common.core.domain.Result;
import com.market.product.remote.factory.RemoteProductServiceFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;

/**
 * 商品服务
 */
@FeignClient(contextId = "productSkuInfoService",value = ServiceNameConstants.PRODUCT_SERVICE,fallbackFactory = RemoteProductServiceFallback.class)
public interface RemoteProductService {
    @GetMapping("/productSkuInfo/updateProductInventory/{productId}/{stock}")
    public Result updateProductInventory(@PathVariable("productId") Integer productId, @PathVariable("stock") Integer stock);

    @PostMapping("/productSkuInfo/queryPriceBySkuId/{id}")
    public Result queryPriceBySkuId(@PathVariable("id") Long id);
}
